/*
 * Copyright (c) 2020, 2023, keyila All rights reserved.
 *
 */
package com.clp.study.designPattern.factoryPattern.easy;

/**
 * @author clp
 * @version 1.0
 */
public class FactoryPatternDemo {
    public static void main(String[] args) {
        ShapeFactory shapeFactory=new ShapeFactory();
        //获取 Circle  的对象,并调用它的draw方法
        Shape circle = shapeFactory.getShape("CIRCLE");
        circle.draw();
        //获取 Rectangle  的对象,并调用它的draw方法
        Shape rectangle = shapeFactory.getShape("RECTANGLE");
        rectangle.draw();
        //获取 Square  的对象,并调用它的draw方法
        Shape square = shapeFactory.getShape("SQUARE");
        square.draw();
    }
}
